
function save()
{
	if(check_name()==false)
		return;
	document.savedepart.action="savedepart.vm";
	document.savedepart.submit();
}




function de_depart(id)
{
	var bool = window.confirm("此操作将会删除该部门及部门下的员工,您确定删除吗?");
	if(bool==true)
	{
		window.location.href="dedepart.vm?id="+id;
	}
}


function updepart()
{
	if(check_name()==false)
		return;
	document.savedepart.action="updepart.vm";
	document.savedepart.submit();
}

function check_name()
{
	if($("#name").val()==null||$("#name").val()=="")
	{
		alert("部门名称不可为空");
		$("#name").focus();
		return false;
	}
}